<template>
	<view id="tab-view">
		<yHeader title="悦管家">
			<template slot="left">
				<!-- <button>后退</button> -->
				<y-tag></y-tag>
			</template>
			<template slot="right">
				<!-- <button>定位</button> -->
			</template>
		</yHeader>

		<view class="content" :style='{"height": (navHeight || 0) + "px"}'>
			<swiper id="swiper-tab-view">
				<swiper-item>
					<homepage></homepage>
				</swiper-item>
				<swiper-item>
					<product-page></product-page>
				</swiper-item>
				<swiper-item>
					<view style="height: 700px;width: 100%;background-color: #8F8F94;">管家</view>
				</swiper-item>
				<swiper-item>
				</swiper-item>
				<swiper-item>
					<my-page></my-page>
				</swiper-item>
			</swiper>
		</view>

		<y-tab></y-tab>
	</view>
</template>

<script>

	import homepage from '../index/index.vue'
	import productPage from '../product/product.vue'
	import myPage from '../my/my.vue'
	import yHeader from '../../components/yHeader/yHeader.vue'
	import yTag from '../../components/yTag/yTag.vue'
	import yTab from '../../components/yTab/yTab.vue'
	const sysInfo = uni.getSystemInfoSync();
	console.log(sysInfo)

	export default {
		data() {
			return {
				navHeight: sysInfo.screenHeight - (sysInfo.statusBarHeight || 0) - (106 * sysInfo.windowWidth / 750) - 44
			};
		},
		onReady() {
			console.log(JSON.stringify(sysInfo))
			console.log(sysInfo.screenHeight - (sysInfo.statusBarHeight || 0) - (106 * sysInfo.windowWidth / 750)) - 44
		},
		onShow() {

		},
		methods: {
			goIndex() {
				uni.navigateTo({
					url: '/pages/index/index'
				})
			}
		},
		onPullDownRefresh() {

		},
		components: {
			homepage,
			productPage,
			myPage,
			yHeader,
			yTag,
			yTab
		}
	}
</script>

<style lang="scss" scoped>
	#tab-view {
		height: 100%;

		.content {
			#swiper-tab-view {
				width: 100%;
				height: 100%;

				swiper-item {
					width: 100%;
					height: auto;
					overflow: scroll;
				}
			}
		}
	}
</style>
